#include "../include/cmdlist.h"

CmdList::CmdList() {
	this->updateCommands();
}

void CmdList::updateCommands() {
	this->commands.clear();

	string path = "/usr/bin";
	for (const auto &entry : filesystem::directory_iterator(path)) {
		string name = entry.path();
		this->commands[name] = name;
	}
}

void CmdList::printCommandNames() {
	for (const auto &cmdItem : this->commands) {
		cout << cmdItem.first << endl;
	}
}
